home *** CD-ROM | disk | FTP | other *** search
- From: soma!sob
- Newsgroups: mod.sources
- Subject: uumail 3.0 (Part 1 of 2)
- Approved: jpn@panda.UUCP
-
- Mod.sources: Volume 4, Issue 91
- Submitted by: soma!sob
-
- #! /bin/sh
- # This is a shell archive, meaning:
- # 1. Remove everything above the #! /bin/sh line.
- # 2. Save the resulting text in a file.
- # 3. Execute the file with /bin/sh (not csh) to create the files:
- # README
- # domains
- # palias
- # rmail.c
- # address.c
- # makefile
- # uux.c
- # uumail.1
- # opath.3
- # address.1
- # Alias.Design
- # Sendmail
- # Binary.Only
- # This archive created: Fri May 2 17:48:10 1986
- export PATH; PATH=/bin:$PATH
- echo shar: extracting "'README'" '(8177 characters)'
- if test -f 'README'
- then
- echo shar: will not over-write existing file "'README'"
- else
- cat << \SHAR_EOF > 'README'
- This is an updated version of uumail (and uupath) that can
- access a pathalias-generated database to facilitate routine mail.
-
- These program can cope with DBM and standard line-oriented forms of
- pathalias-generated databases.
-
- This version of uumail can be used as uupath by linking uumail to
- uupath. Also, this version can handle domain addresses (user@host.domain).
- You can put as many addresses on a line as you like.
-
- This version provides an alias and forwarding facility. For details on
- aliasing see the file "Alias.Design". The forward facility is similiar to
- the one in sendmail. A user may forward his mail by adding a file called
- ".forward" in his home directory. This file conatains the address(es) to which
- mail is to be forwarded. These addresses are not reprocessed by the aliasing
- subroutine, but may be in domain format (if the -DOPATH flag is used when
- compiling and the /usr/lib/uucp/domains file is correctly configured).
-
- There is also some experimental sections in this release that binary only
- sites might like to experiment with. See the file "Binary.Only" for details on
- this experiment.
-
- There has been some confusion in the past on configuring uumail to work
- with sendmail. See the file "Sendmail" for information on this.
-
- * IF YOU ARE USING A DBM DATABASE, READ THIS!
- * If the special sentinel value of @@@ is not present in the
- * database, then getpath will assumed that the database is being
- * rebuilt and will block for TIMEOUT (default = 180) seconds.
- * If, after 5 such blocks, the sentinel is not present,
- * the error code EX_TEMPFAIL is returned.
- * The same is true if the dbm files cannot be initialized.
- * Please be sure to add the sentinal to the DBM database when
- * it is created.
- * To add the sentinel, use the "makedb" command.
- * makedb -a dbrootname < @@@
- * should append the sentinel to the database.
-
- There are some compile flags to be aware of when making uumail.
- When defining these, place them on the OPTIONS line in the makefile.
- Here is a list of them.
-
- DEBUG compiles in the debugging code.
- OPATH causes the opath subroutine to be used to resolve addresses.
- If you do not use this flag, you cannot use the user@host.domain style
- addresses with uumail.
- DBM causes uumail to use the DBM format patalias database. If you do not
- have the dbm libraries, do not use this flag.
- SYSIII will make adjustments for system that are derived from UNIX System
- III or System V.
- NOGRADE should be used if your uux does not understand the -g flag.
- NORETURN should be used if your uux does not understand the -a flag.
- LOG will enable logging of uumail traffic (be sure that the file
- you specify in uuconf.h is world writable or this option will not work).
- UGLYUUCP causes the From_ line produced by uumail to contain the
- "remote from hostname" string. This is usually necessary for reliable
- use of uumail especially on SYSV and V7 machines.
- GETHOSTNAME will cause the system call gethostname to be used. If you
- are a BSD site, define this.
- SYSTEMNAME will cause the systemname to be derived from the file
- /usr/lib/uucp/SYSTEMNAME. This should be defined if your machine
- is a Sperry 5000.
- SORTED will cause the non-DBM database to be searched fasted, BUT
- it assumes that this database is SORTED. If you do not sort your
- database, do not define this.
- NOALIAS will not compile in the Aliasing and Forward facilities.
- You probably want to define this if you are running sendmail or some
- other mailer that already does this.
- OPIMIZE will attempt to send mail by a "more optimal" path. This
- is experimental.
- RFC976 will cause uumail to behave as a CLASS 3 mailer as defined in
- RFC976. Defining this flag may cause your mail to behave differently
- than it has in the past (particularly if you are a UUCP-only site). Please
- be sure to read the RFC carefully to understand the differences between
- the different class of mailers. See more on this below.
-
- There are some other items that should be noted when configuring uumail.
- In the makefile, set UUMAIL equal to the location of the uumail program
- on your system FOLLOWING INSTALLATION! Set REALUUX equal to the location
- of the uux program. This will be /usr/bin/uux on most systems. Binary
- only site should check the "Binary.Only" file for more information on
- the use of this symbol. BINDIR should be set to the directory you want
- the address and uupath program to go, usually /usr/ucb, /usr/local, or
- /usr/lbin.
-
- If you want to install this system, use "make install". If you want
- to have it do all the work for incoming mail, type "make mailer". You
- probably do not want to "make mailer" if you run sendmail.
-
- A manual page for address, opath, uumail and uupath are included.
-
-
- RFC976 Compliance notes
-
- Uumail is capable of satisfying Class 3 requirements as specified in
- RFC976. It can also be compiled to satisfy Class 2 and Class 1 requirements
- only. Here are the appropriate compile time flags for compliance with
- with the three classes; these are only the flags necessary to make
- uumail perform in a particular class. Other flags may be needed to use
- the dbm-type database and other options. It should be noted that each
- higher numbered class is a superset of the lower numbered class,
- so if you are a class 3 you will automatically comply with Classes 1
- and 2. The following is excerpted from the RFC976 document.
-
-
- Class 1 old-style UUCP ! routing only. We assume that the host
- understands local user names:
-
- rmail user
-
- and bang paths
-
- rmail host1!host2!user
-
- but we assume nothing more about the host. If we have
- no information about a host, we can treat it as class 1
- with no problems, since we make no assumptions about
- how it will handle hybrid addresses.
-
- COMPILE FLAGS NEED FOR THIS CLASS: UGLYUUCP
-
-
-
- Class 2 Old style UUCP ! routing, and 4.2BSD style domain
- parsing. We assume the capabilities of class 1, plus
- the ability to understand
-
- rmail user@domain
-
- if the "domain" is one outside the UUCP zone which
- the host knows about. Class 2 hosts do not necessarily
- understand domain!user or have routers. Hosts in non-
-
- UUCP RFC-920 domains are considered class 2, even though
- they may not understand host!user.
-
- COMPILE FLAGS NEED FOR THIS CLASS: OPATH UGLYUUCP
-
- Class 3 All class 1 and 2 features are present. In addition,
- class 3 hosts must be able to route UUCP mail for hosts
- that are not immediately adjacent and also understand
- the syntax
-
- rmail domain!user
-
- as described above. All gateways into UUCP must be
- class 3.
-
- COMPILE FLAGS NEED FOR THIS CLASS: OPATH UGLYUUCP RFC976
-
- One final note: Uumail does not use the Algorithm specified in RFC976
- to perform its work. That algorithm is likely to be a part of
- the Batch SMTP program referred to in the RFC.
-
- Please forward comments and bug fixes to me at sob@rice.edu or
- ihnp4!shell!soma!sob or seismo!drillsys!sob or sdcsvax!drillsys!sob.
-
- Stan Barber
- Baylor College of Medicine
- Houston, Texas
-
- P.S. My thanks to all those who reported bugs from the previous release.
- Please continue to send them in, and I will try to keep fixing them.
-
-
- ***************************************************************************
- This work in its current form is Copyright 1986 Stan Barber
- with the exception of opath, gethostname and the original getpath which
- as far as I know are in the Public Domain. This software may be distributed
- freely as long as no profit is made from such distribution and this notice
- is reproducted in whole.
- ***************************************************************************
- This software is provided on an "as is" basis with no guarantee of
- usefulness or correctness of operation for any purpose, intended or
- otherwise. The author is in no way liable for this software's performance
- or any damage it may cause to any data of any kind anywhere.
- ***************************************************************************
-
- SHAR_EOF
- if test 8177 -ne "`wc -c < 'README'`"
- then
- echo shar: error transmitting "'README'" '(should have been 8177 characters)'
- fi
- fi
- echo shar: extracting "'domains'" '(1093 characters)'
- if test -f 'domains'
- then
- echo shar: will not over-write existing file "'domains'"
- else
- cat << \SHAR_EOF > 'domains'
- #
- # Domain Table
- #
- # Format: <domain>,<prefix>,<suffix>,<template>
- #
- # Where <template> may contain:
- # %P - prefix string
- # %S - suffix string
- # %U - destination user name
- # %N - destination site name
- # %D - destination site name with domain suffix
- # %% - a percent (%) sign
- # %R - pathalias route to the destination site
- #
- .WA.UUCP,,,%R!%U
- .OR.UUCP,,,%R!%U
- .N-CA.UUCP,,,%R!%U
- .S-CA.UUCP,,,%R!%U
- .MTN.UUCP,,,%R!%U
- .S-CEN.UUCP,,,%R!%U
- .MID-W.UUCP,,,%R!%U
- .S-EAST.UUCP,,,%R!%U
- .ATL.UUCP,,,%R!%U
- .N-ENG.UUCP,,,%R!%U
- .HI.UUCP,,,%R!%U
- .W-CAN.UUCP,,,%R!%U
- .E-CAN.UUCP,,,%R!%U
- .EUR.UUCP,,,%R!%U
- .UK.UUCP,,,%R!%U
- .AUS.UUCP,,,%R!%U
- .ISRAEL.UUCP,,,%R!%U
- .ATT.UUCP,>ihnp4,,%P!%D!%U
- .HP.UUCP,,,%R!%U
- .PE.UUCP,,,%R!%U
- .UUCP,,,%R!%U
- .CSNET,>rice,,%P!%U%%%D@CSNET-RELAY.ARPA
- .MAILNET,>rice,,%P!%U%%%D@MULTICS.MIT.EDU
- # .BITNET,>rice,,%P!%U%%%D@WISCVM.ARPA
- .XEROX,>rice,,%P!%U.%D@XEROX.ARPA
- .DEC,>decwrl,,%P!%U@%D
- .ARPA,>rice,,%P!%U@%D
- .EDU,>rice,,%P!%U@%D
- .COM,>rice,,%P!%U@%D
- .GOV,>rice,,%P!%U@%D
- .MIL,>rice,,%P!%U@%D
- .OTH,>rice,,%P!%U@%D
- .BITNET,>psuvax,,%P!%U@%D
- SHAR_EOF
- if test 1093 -ne "`wc -c < 'domains'`"
- then
- echo shar: error transmitting "'domains'" '(should have been 1093 characters)'
- fi
- fi
- echo shar: extracting "'palias'" '(151 characters)'
- if test -f 'palias'
- then
- echo shar: will not over-write existing file "'palias'"
- else
- cat << \SHAR_EOF > 'palias'
- baylor baylor!%s
- decwrl shell!ihnp4!decwrl!%s
- ihnp4 shell!ihnp4!%s
- kitty baylor!kitty!%s
- neuro1 %s
- psuvax shell!psuvax!%s
- rice rice!%s
- shell shell!%s
- SHAR_EOF
- if test 151 -ne "`wc -c < 'palias'`"
- then
- echo shar: error transmitting "'palias'" '(should have been 151 characters)'
- fi
- fi
- echo shar: extracting "'rmail.c'" '(3533 characters)'
- if test -f 'rmail.c'
- then
- echo shar: will not over-write existing file "'rmail.c'"
- else
- cat << \SHAR_EOF > 'rmail.c'
- #ifndef lint
- static char rcsid[]="$Header: rmail.c,v 3.0 86/03/14 12:04:54 sob RELEASE_3 $";
-
- #endif
-
- /*
- ** RMAIL -- UUCP mail server.
- **
- ** This program reads the >From ... remote from ... lines that
- ** UUCP is so fond of and turns them into something reasonable.
- ** It calls uumail giving it a -f option built from these
- ** lines.
- ***************************************************************************
- This work in its current form is Copyright 1986 Stan Barber
- with the exception of opath, gethostname and the original getpath which
- as far as I know are in the Public Domain. This software may be distributed
- freely as long as no profit is made from such distribution and this notice
- is reproducted in whole.
- ***************************************************************************
- This software is provided on an "as is" basis with no guarantee of
- usefulness or correctness of operation for any purpose, intended or
- otherwise. The author is in no way liable for this software's performance
- or any damage it may cause to any data of any kind anywhere.
- ***************************************************************************
- */
-
- #define _DEFINE
-
- #include "uuconf.h"
- extern FILE *popen();
- extern char *index();
- extern char *rindex();
-
- # define MAILER "/usr/lib/uucp/uumail"
-
- main(argc, argv)
- char **argv;
- {
- FILE *out; /* output to mail handler */
- char lbuf[512]; /* one line of the message */
- char from[512]; /* accumulated path of sender */
- char ufrom[64]; /* user on remote system */
- char sys[64]; /* a system in path */
- char junk[512]; /* scratchpad */
- char cmd[2000];
- register char *cp;
- register char *uf; /* ptr into ufrom */
- int i;
-
- # ifdef DEBUG
- if (argc > 1 && strcmp(argv[1], "-T") == 0)
- {
- Debug = TRUE;
- argc--;
- argv++;
- }
- # endif DEBUG
-
- if (argc < 2)
- {
- fprintf(stderr, "Usage: rmail user ...\n");
- exit(EX_USAGE);
- }
-
- (void) strcpy(from, "");
- (void) strcpy(ufrom, "/dev/null");
- uf = NULL;
-
- for (;;)
- {
- (void) fgets(lbuf, sizeof lbuf, stdin);
- if (strncmp(lbuf, "From ", 5) != 0 && strncmp(lbuf, ">From ", 6) != 0)
- break;
- (void) sscanf(lbuf, "%s %s", junk, ufrom);
- cp = lbuf;
- uf = ufrom;
- for (;;)
- {
- cp = index(cp+1, 'r');
- if (cp == NULL)
- {
- register char *p = rindex(uf, '!');
-
- if (p != NULL)
- {
- *p = '\0';
- if (uf != NULL)
- (void) strcpy(sys, uf);
- else
- gethostname(sys,32);
- uf = p + 1;
- break;
- }
- cp = "remote from somewhere";
- }
- #ifdef DEBUG
- if (Debug)
- printf("cp='%s'\n", cp);
- #endif
- if (strncmp(cp, "remote from ", 12)==0)
- break;
- }
- if (cp != NULL)
- (void) sscanf(cp, "remote from %s", sys);
- (void) strcat(from, sys);
- (void) strcat(from, "!");
- #ifdef DEBUG
- if (Debug)
- printf("ufrom='%s', sys='%s', from now '%s'\n", uf, sys, from);
- #endif
- }
- if (uf != NULL)
- (void) strcat(from, uf);
-
- /* (void) sprintf(cmd, "exec %s -em -f%s", MAILER, from);*/
- if (from[0] == '\0')
- (void) sprintf(cmd, "exec %s", MAILER);
- else
- (void) sprintf(cmd, "exec %s -f%s", MAILER, from);
- while (*++argv != NULL)
- {
- (void) strcat(cmd, " '");
- if (**argv == '(')
- (void) strncat(cmd, *argv + 1, strlen(*argv) - 2);
- else
- (void) strcat(cmd, *argv);
- (void) strcat(cmd, "'");
- }
- #ifdef DEBUG
- if (Debug)
- printf("cmd='%s'\n", cmd);
- #endif
- out = popen(cmd, "w");
- fputs(lbuf, out);
- while (fgets(lbuf, sizeof lbuf, stdin))
- fputs(lbuf, out);
- i = pclose(out);
- if ((i & 0377) != 0)
- {
- fprintf(stderr, "pclose: status 0%o\n", i);
- exit(EX_OSERR);
- }
-
- exit((i >> 8) & 0377);
- }
- SHAR_EOF
- if test 3533 -ne "`wc -c < 'rmail.c'`"
- then
- echo shar: error transmitting "'rmail.c'" '(should have been 3533 characters)'
- fi
- fi
- echo shar: extracting "'address.c'" '(1228 characters)'
- if test -f 'address.c'
- then
- echo shar: will not over-write existing file "'address.c'"
- else
- cat << \SHAR_EOF > 'address.c'
- /*
- * address - run opath to see what a translated RFC822 address will come
- * out as.
- *
- * By E. Roskos 1/16/85
- * $Log: address.c,v $
- * Revision 3.0 86/03/14 12:04:19 sob
- * Release of 3/15/86 --- 3rd Release
- *
- * Revision 1.4 85/12/26 15:47:45 sob
- * Added modifications suggested by terry%owl@rand-unix.ARPA
- *
- * Revision 1.3 85/11/24 14:50:01 sob
- * Added corrections provided by regina!mark
- *
- * Revision 1.2 85/09/16 18:31:53 sob
- * Added DEBUG flag
- *
- * Revision 1.1 85/09/16 17:50:24 sob
- * Initial revision
- *
- */
- #define _DEFINE
- #include "uuconf.h"
-
- static char rcsid[] = "$Header: address.c,v 3.0 86/03/14 12:04:19 sob RELEASE_3 $";
-
- EXTERN char *paths;
- char *opath(), *oupath();
- int Debug;
-
- main(argc,argv)
- int argc;
- char **argv;
- {
- char *p;
- int uswitch;
-
- paths = DATABASE;
- ConfFile=CONFIGFILE;
-
- if (argc < 2)
- {
- fprintf(stderr,"usage: %s rfcaddress [...]\n",
- argv[0]);
- exit(1);
- }
-
- while (--argc)
- {
- p = *++argv;
- if (*p=='-')
- {
- switch(*++p)
- {
- case 'u': uswitch++;
- continue;
- case 'd': Debug++;
- continue;
- default: printf("unknown switch: %c\n",*p);
- continue;
- }
- }
- printf("%s: %s\n",p,uswitch?oupath(p):opath(p));
- }
-
- exit(0);
- }
- SHAR_EOF
- if test 1228 -ne "`wc -c < 'address.c'`"
- then
- echo shar: error transmitting "'address.c'" '(should have been 1228 characters)'
- fi
- fi
- echo shar: extracting "'makefile'" '(3095 characters)'
- if test -f 'makefile'
- then
- echo shar: will not over-write existing file "'makefile'"
- else
- cat << \SHAR_EOF > 'makefile'
- ####################################################################
- # makefile for uumail & uupath
- # program to integrate with pathalias created uucpmap databases
- # programs originally developed by Jeff Donnelly
- # updated to use pathalias database by Stan Barber
- # $Header: makefile,v 1.5 86/02/26 03:33:10 sob Exp $
- #***************************************************************************
- # This work in its current form is Copyright 1986 Stan Barber
- # with the exception of opath, gethostname and the original getpath which
- # as far as I know are in the Public Domain. This software may be distributed
- # freely as long as no profit is made from such distribution and this notice
- # is reproducted in whole.
- # ***************************************************************************
- #
- ###############################################################
- .SUFFIXES: .c,v .h,v
-
-
-
- LIBS=
-
- BINDIR=/usr/lbin
-
- UUCPDIR=/usr/lib/uucp
-
- LIBDIR=/usr/lib
-
- UUMAIL=$(UUCPDIR)/uumail
-
- REALUUX=/usr/bin/uux
-
- OPTIONS= -DOPATH -DSYSIII -DDEBUG -DUGLYUUCP -DLOG -DSORTED
-
- CFLAGS= -O -DUUMAIL='"$(UUMAIL)"' -DREALUUX='"$(REALUUX)"' $(OPTIONS)
-
- SHELL=/bin/sh
- DIST1=README domains palias rmail.c
- DIST2= opath.c uumail.c uuconf.h gethostnam.c getpath.c alias.c
- DIST3= address.c makefile uux.c
- DIST4= uumail.1 opath.3 address.1 Alias.Design Sendmail Binary.Only
-
- DIST= $(DIST1) $(DIST2) $(DIST3) $(DIST4)
-
-
- .c,v.c:
- co -q $*.c
-
- .h,v.h:
- co -q $*.h
-
- all: uumail rmail address uux
-
- uumail: getpath.o uumail.o gethostnam.o opath.o alias.o
- cc $(CFLAGS) getpath.o uumail.o gethostnam.o opath.o alias.o -o uumail $(LIBS)
-
- address:address.o opath.o getpath.o
- cc $(CFLAGS) address.o opath.o getpath.o -o address $(LIBS)
-
- uux: uux.o
- cc $(CFLAGS) uux.o -o $@ $(LIBS)
-
- getpath.o: getpath.c uuconf.h
-
- uupath.o: uupath.c uuconf.h
-
- uumail.o: uumail.c uuconf.h
-
- gethostnam.o:gethostnam.c
-
- address.o:address.c
-
- opath.o:opath.c
-
- alias.o:alias.c
-
- aliascheck.o:aliascheck.c
-
- rmail: rmail.c gethostnam.o
- cc $(CFLAGS) rmail.c gethostnam.o -o rmail $(LIBS)
-
- install: uumail address domains palias
- cp address $(BINDIR)
- cp uumail $(UUCPDIR)
- if [ ! -r $(UUCPDIR)/domains ]; then cp domains $(UUCPDIR); fi
- if [ ! -r $(UUCPDIR)/palias ]; then cp palias $(UUCPDIR); fi
- @echo "To install rmail in place of the current rmail, type"
- @echo "make mailer"
- @echo "To intercept uux commands, you need to be sure"
- @echo "that you correctly specified REALUUX in makefile"
- @echo "Then type make fakeuux"
- ln $(UUCPDIR)/uumail $(BINDIR)/uupath
-
- mailer: rmail
- make install
- rm -rf /bin/rmail
- cp rmail /bin/rmail
-
- fakeuux: uux
- make install
- cp /usr/bin/uux $(REALUUX)
- cp uux /usr/bin/uux
- chmod 6755 /usr/bin/uux
-
- lint:
- lint $(CFLAGS) getpath.c uumail.c gethostnam.c opath.c alias.c
-
- clean:
- rm -f *.o uumail address rmail uux
-
- doc: uumail.1 uupath.1 address.1 opath.3
- nroff -man uumail.1 >uumail.cat; nroff -man uupath.1 >uupath.cat; nroff -man address.1 >address.cat; nroff -man opath.3 >opath.cat
-
- shar: $(DIST)
- shar -v $(DIST1) > dist1.out;shar -v $(DIST2)> dist2.out;shar -v $(DIST3) > dist3.out;shar -v $(DIST4) > dist4.out
-
-
- SHAR_EOF
- if test 3095 -ne "`wc -c < 'makefile'`"
- then
- echo shar: error transmitting "'makefile'" '(should have been 3095 characters)'
- fi
- fi
- echo shar: extracting "'uux.c'" '(3649 characters)'
- if test -f 'uux.c'
- then
- echo shar: will not over-write existing file "'uux.c'"
- else
- cat << \SHAR_EOF > 'uux.c'
- /*
- * a "fake" uux to replace the realone to allow uumail to intercept
- * mail at sites that mail not be able to recompile their mailers
- * Called via "uux - system!rmail user" from, normally, /bin/mail.
- ***************************************************************************
- This work in its current form is Copyright 1986 Stan Barber
- with the exception of opath, gethostname and the original getpath which
- as far as I know are in the Public Domain. This software may be distributed
- freely as long as no profit is made from such distribution and this notice
- is reproducted in whole.
- ***************************************************************************
- This software is provided on an "as is" basis with no guarantee of
- usefulness or correctness of operation for any purpose, intended or
- otherwise. The author is in no way liable for this software's performance
- or any damage it may cause to any data of any kind anywhere.
- ***************************************************************************
- * $Log: uux.c,v $
- * Revision 3.0 86/03/14 12:05:06 sob
- * Release of 3/15/86 --- 3rd Release
- *
- * Revision 1.6 86/03/14 11:57:51 sob
- *
- *
- * Revision 1.5 86/03/11 11:29:17 sob
- * Added Copyright Notice
- *
- * Revision 1.4 86/02/17 18:07:48 sob
- * Moved REALUUX and UUMAIL definitions to the makefile
- *
- * Revision 1.3 86/02/17 17:58:15 sob
- * Small syntax problem
- *
- * Revision 1.2 86/02/17 17:55:45 sob
- * Corrected to remove parens from destbuf.
- *
- * Revision 1.1 86/02/17 17:45:10 sob
- * Initial revision
- *
- *
- */
-
- #define _DEFINE
-
- #include "uuconf.h"
- static char rcsid[] = "$Header: uux.c,v 3.0 86/03/14 12:05:06 sob RELEASE_3 $";
-
- extern FILE *popen();
- extern char *index();
- extern struct passwd *getpwnam();
-
- char sysbuf[BUFSIZ];
- char destbuf[BUFSIZ];
-
- main(argc, argv)
- int argc;
- char **argv;
- {
- char *command;
- struct passwd *pwd;
- char cmd[BUFSIZ];
- char *system = sysbuf;
- char **psystem = &system;
- FILE *netf;
- int c;
-
- if ((argc != 4) || strcmp("-", argv[1])) /* look for form
- of uux command */
- realuux(argv);
-
- strcpy(sysbuf, argv[2]); /* save destination system */
-
- if ((command = index(sysbuf, '!')) == NULL)
- realuux(argv);
- *command++ = 0;
- if (strcmp("rmail", command)) /* look for rmail in command */
- realuux(argv);
-
- mystrcpy(destbuf, argv[3]); /*save destination path */
- /* but get rid of parens */
- /* become UUCP */
- setpwent();
- pwd = getpwnam("uucp");
- if (pwd == NULL) {
- fprintf(stderr, "Can't suid to \"uucp\" in %s\n", REALUUX);
- exit(1); /* sigh */
- }
- endpwent();
- setuid(pwd->pw_uid);
-
- /* send the mail to uumail */
- sprintf(cmd, "uumail %s!%s", UUMAIL, sysbuf,destbuf);
- if ((netf = popen(cmd, "w")) == NULL)
- exit(EX_TEMPFAIL); /* failure */
-
- /* send the actual mail */
- while ((c = getchar()) != EOF)
- putc(c, netf);
- fflush(netf);
- exit (pclose(netf)?1:0); /* causes mail to do the right thing */
- }
-
- realuux(argv)
- char **argv;
- {
- int pid, sts;
-
- /* running suid root. become us again */
- setuid(getuid());
-
- if ((pid = fork()) == -1) {
- fprintf(stderr, "uux: can't create proc for %s\n",REALUUX);
- exit(1);
- }
- if (pid) {
- while (wait(&sts) != pid) {
- if (wait(&sts)==-1)
- exit(1);
- }
- exit(sts?1:0);
- }
- execv(REALUUX, argv);
- fprintf(stderr, "uux: can't exec %s\n",REALUUX);
- exit (1);
- }
-
- /* remove parens for t and put what's left in s */
- mystrcpy(s,t)
- char * s, *t;
- {
- int x;
- while (x = *t++){
- if ((x == '(') || (x == ')'))
- continue;
- *s++ = x;
- }
-
- *s = x;
- }
- SHAR_EOF
- if test 3649 -ne "`wc -c < 'uux.c'`"
- then
- echo shar: error transmitting "'uux.c'" '(should have been 3649 characters)'
- fi
- fi
- echo shar: extracting "'uumail.1'" '(2865 characters)'
- if test -f 'uumail.1'
- then
- echo shar: will not over-write existing file "'uumail.1'"
- else
- cat << \SHAR_EOF > 'uumail.1'
- .TH "UUMAIL" "8" "Baylor College of Medicine"
- .fi
- .ad b
- .SH NAME
- uumail \- rewrite address & route mail using uucpmap database
- .br
- uupath \- print the uucp path to a host
- .SH SYNOPSIS
- .B uumail [ \fIoptions\fR ] \fIaddress\fR
- .br
- .B uupath \fIhostname\fR
- .SH DESCRIPTION
- .B Uumail
- is designed to be used as a mail delivery program to correctly
- route mail over uucp connections.
- .SS Standard Options
- .IP "-f\fIaddress\fR" 16
- The
- .I -f
- option sets the address of the sender of the mail. If this flag
- is not used, the sender will be established by usings environmental variables
- (like
- .B LOGNAME
- and
- .B USER
- ) or using getlogin(3).
- .IP "-C\fIconfigfile\fR" 16
- The
- .I -C
- option allows an alternative configuration file to be specified.
- .IP "-om" 16
- The
- .I -om
- option causes the mail to also be sent to the sender of the message.
- .IP "-oc" 16
- The
- .I -oc
- option causes
- .B uucico
- to be started immediately after queuing the mail.
- The default just queues the mail.
- .IP "-h" 16
- The -h option causes no From_ line to be added to the beginning of file.
- This is useful when uumail is being used as a mailer for sendmail(8).
- .SS Compile-time Configurable Options
- .IP "-d[1-6]" 16
- The
- .I -d
- option turns on the limited debugging facility built into the
- mailer. In debug mode, the mailer does not actually mail anything, but
- tells you what it would do if it did do it. The level of debugging can
- be set by following the
- .I -d
- flag with a number between 1 and 6.
- .IP "-g[A-Z]" 16
- If your
- .B uux(1)
- supports grading of transactions, the
- .I -g
- option can be used to set the
- grade of this mail. A grade of \fIC\fR is used by default.
- .IP "-n" 16
- The
- .I -n
- option will prohibit the use of infomation provided by the system alias
- file. Information in users'
- .I .forward
- files will still be utilized if present.
-
- .SS Arguments
- .IP \fIhost!user\fR 16
- where host is a system node name on the network and user is the login
- name of the addressee.
- .IP \fIuser@host.domain\fR
- same as above with the addition of a domain specifier like
- .B .ARPA, .GOV, .COM, .EDU
- etc.
- .SH FILES
- .IP "/usr/lib/uucp/Aliases" 20
- System-wide alias file
- .IP ".forward" 20
- Individual user's mail forwarding file
- .IP "/usr/lib/uucp/palias{.pag|.dir}" 20
- Path file produced by pathalias.
- .IP "/usr/lib/uucp/uucp/domains" 20
- Domain rewriting rules for opath(3).
- .IP "/usr/adm/uumail.log" 20
- Log of uumail activity.
- .SH "SEE ALSO"
- pathalias(1), address(1), mh(1), opath(3), sendmail(8), uux(1)
- .br
- .B RFC 822 "Standard for the Format of ARPA Internet Text Messages"
- .br
- .B RFC 976 "UUCP Mail Interchange Format Standard"
-
- .SH AUTHORS
- .br
- Stan Barber, Baylor College of Medicine
- .br
- Getpath routine by John Donnelly, University of Illinois
- .br
- Gethostname routine by Peter Honeyman, Princeton
- .br
- Opath routine by Eric Roskos, CONCURRENT Computers
- .br
- Aliasing scheme borrowed from the MH mail handling system
-
- SHAR_EOF
- if test 2865 -ne "`wc -c < 'uumail.1'`"
- then
- echo shar: error transmitting "'uumail.1'" '(should have been 2865 characters)'
- fi
- fi
- echo shar: extracting "'opath.3'" '(5023 characters)'
- if test -f 'opath.3'
- then
- echo shar: will not over-write existing file "'opath.3'"
- else
- cat << \SHAR_EOF > 'opath.3'
- .TH OPATH 3 local
- .SH NAME
- opath - Generate a UUCP route from an RFC822/RFC976 address
- .br
- oupath - Generate a UUCP route from a (possibly disconnected) UUCP path
- .SH SYNOPSIS
- char *opath(s)
- .br
- char *s;
- .sp 1
- char *oupath(s)
- .br
- char *s;
- .SH DESCRIPTION
- These routines use the \fBpathalias\fR database to generate UUCP routing
- paths from your local site to specified remote sites on either the UUCP
- network or other connected networks.
- .PP
- \fBopath\fR takes one argument, an RFC822/RFC976 address, as described in
- ADDRESS(1). From this, it generates and returns a UUCP path to the site
- named in the argument.
- .PP
- \fBoupath\fR takes one argument, a UUCP path. If the next site on this
- path is named \fIx\fR, \fBoupath\fR will prepend a path from your site to
- \fIx\fR, if \fIx\fR is nonadjacent to your site. If \fIx\fR is a domain,
- i.e. contains a dot (.), \fBoupath\fR will generate a path to a gateway
- for this domain. Note that \fBoupath\fR will \fInot\fR alter the argument
- path, other than to make the above transformations; it does not check whether
- sites in the argument are adjacent to one another, or whether they represent
- an optimal path; it is assumed that if the user has specified a path, then
- he wants to use that path.
- .PP
- The principal difference between \fBopath\fR and \fBoupath\fR is that the
- former gives precedence to ``@'', whereas the latter gives precedence
- to ``!''. The former is intended to be invoked when receiving mail from
- a user interface or a non-UUCP source (if the subsequent transport mechanism
- is to be UUCP), whereas the latter is intended solely to be used by UUCP
- internal software, principally \fBrmail\fR, in routing mail through the
- UUCP network.
- .SH "FILES"
- \fI/usr/lib/uucp/palias\fR - The pathalias database.
- See PATHALIAS(1) for information; pathalias is a public-domain program
- distributed via the Usenet's net.sources facility.
- .br
- .sp 1
- \fI/usr/lib/uucp/domains\fR - The domain/gateway table. Each line of this
- file consists of either a ``#'' followed by arbitrary comment text, or
- an entry of the form:
- .br
- .in 1i
- <domain>,<path>,<reserved>,<template>
- .br
- .in
- Where <domain> is the string (in capital letters) identifying a particular
- <path> is a string which may be included at an arbitrary point in the
- generated route, <reserved> is currently unused, and <template> is a string
- indicating the format of the generated route.
- .PP
- The <template> is a printf-style string; it is \fBnot\fR quoted, and
- begins at the character immediately following the comma which separates
- <template> from <reserved>. The <template> may consist of arbitrary ASCII
- characters, which are copied unchanged into the generated route; or of
- a percent (%) sign followed by one of the following characters:
- .IP P
- The <path> string is inserted. The <path> may consist either of a string
- which is inserted unchanged; or of the character ``>'' followed by the
- name of a UUCP site, in which case the entire <path> string is replaced
- with a string representing the path to the named site. The last token on
- this string is the site named in the original <path> string, without a
- following ``!''.
- .IP U
- The user name from the original address is inserted.
- .IP N
- The site name from the original address, with the domain specifiers
- removed, is inserted.
- .IP D
- The site name from the original address, including the domain specifiers,
- is inserted.
- .IP R
- The UUCP path to the site named in the original address is looked up in
- the pathalias database and inserted. Note that this path is looked up
- only when the %R is seen while scanning the <template>, so an error message
- for an invalid site name is generated if and only if it appears in an
- address with a domain which contains a %R in its template.
- .PP
- When making entries in the domain table, domain names which are a suffix of
- another domain name in the table should be ordered such that the longer
- string(s) appear first. For example, .WA.UUCP should preceed .UUCP in
- the table. A linear search is made of the table, and the first domain
- found in the table which is a suffix of the domain in the designated address
- is used as the domain in generating the routing.
- .PP
- Following are some example entries for the domain table. Note that all
- domain names begin with a ``.''.
- .sp 1
- .nf
- .in 1i
- # This is a comment
- \&.HP.UUCP,,,%R!%U
- \&.UUCP,,,%R!%U
- \&.CSNET,>decwrl,,%P!%U%%%S@CSNET-RELAY.ARPA
- \&.EDU,>ucbvax,,%P!%D
- .in
- .fi
- .sp 1
- .SH "SEE ALSO"
- pathalias(1), address(1), rmail(1), uumail(8)
- .br
- .B RFC 822 "Standard for the Format of ARPA Internet Text Messages"
- .br
- .B RFC 976 "UUCP Mail Interchange Format Standard"
- .SH "AUTHOR"
- Eric Roskos, CONCURRENT COMPUTERS
- .SH "NOTE"
- The <reserved> field in the domain table currently has a function which
- may be determined by examining the source code for opath. However, this
- function is a vestigal function provided for sites that used an earlier
- version of opath; future opath versions will use this field for a different
- purpose, and new users of opath therefore should \fBnot\fR use this field.
- SHAR_EOF
- if test 5023 -ne "`wc -c < 'opath.3'`"
- then
- echo shar: error transmitting "'opath.3'" '(should have been 5023 characters)'
- fi
- fi
- echo shar: extracting "'address.1'" '(3735 characters)'
- if test -f 'address.1'
- then
- echo shar: will not over-write existing file "'address.1'"
- else
- cat << \SHAR_EOF > 'address.1'
- .TH ADDRESS 1 local
- .SH NAME
- address - display the path generated by \fBuumail\fR for an
- RFC822/RFC976-format address.
- .SH SYNOPSIS
- address rfc-address [ ... ]
- .SH DESCRIPTION
- This program allows you to check the UUCP mail routing path that will
- be generated by the UUCP mailer \fBuumail\fR if you specify an
- RFC822/RFC976-format address \fBrfc-address\fR in the ``To:'' field of the mail header.
- For each RFC-style address on the command line, \fBaddress\fR echoes the
- address to the standard output, followed by a colon, followed by
- the UUCP address that will be used to send the message to that address.
-
- .SH "ADDRESS FORMAT"
- Briefly, the RFC822/RFC976-format address is of the form
- .nf
- .sp 1
- <localaddress>@<hostname>.<network>
- .sp 1
- .fi
- where <hostname> is the name of the system you are sending the message
- to, <network> is a modifier for <hostname> identifying the network in
- which the address is to be interpreted (UUCP, ARPA, MAILNET, CSNET, etc);
- and <localaddress> is an address string to be interpreted on the host
- machine.
-
- The <localaddress> field may contain further remote addresses to be
- interpreted on the host machine. Typically this will be an address for
- mailing via another network; and in particular, the <localaddress> may
- (recursively) be identical in format to the RFC address, but with
- the symbol `%' replacing the symbol `@' in the standard address format.
- Where this form is used, the rightmost % is replaced by an
- @ before the host machine sends the message out.
-
- On our system, the presently
- valid <network>s are UUCP, ARPA, CSNET, and MAILNET.
- The recently proposed UUCP domain names are also accepted, although
- they are treated the same as plain ``UUCP''.
- Omitting
- the <network> causes the network to default to UUCP. The <hostname>
- should be the name of a remote machine to which the message is
- directed; see \fI/usr/lib/uucp/uuaddress.alpha\fR for a list of all
- known UUCP hostnames. It is \fInot\fR necessary to specify a UUCP pathname
- when using this format; the pathname is automatically determined for you
- and substituted into the address before mailing. The selected pathname
- is determined using the \fBpathalias\fR database, and is supposed
- to be optimal, taking into consideration information provided by
- each site about how often they send mail out, etc.
-
- .SH EXAMPLES
- .HP 5
- joe
- .br
- The message is sent to the user ``joe'' on the local system.
- .HP 5
- joe@ucbvax
- .br
- The message is sent to joe on the UUCP system named ``ucbvax''; this
- address is automatically translated to a proper (and ostensibly
- optimal) UUCP path.
- .HP 5
- joe@ucbvax.UUCP
- .br
- Same as joe@ucbvax
- .HP 5
- joe@ucbvax.ARPA
- .br
- The message is addressed to joe at ucbvax, using the ARPA network.
- The message will be routed to the ARPAnet via a UUCP-ARPAnet gateway.
- .HP 5
- joe%mit-multics.ARPA@ucbvax
- .br
- The message is sent to ucbvax, who then uses the address
- joe@mit-multics.ARPA to send the message on to mit-multics via the
- ARPAnet. Since ucbvax is on the arpanet, this address will work correctly
- (as long as there is someone named joe on the MIT multics machine).
- .HP 5
- joe%vanderbilt.MAILNET%mit-multics.ARPA@ucbvax
- .br
- The message is sent via UUCP to ucbvax, who then sends the message
- to mit-multics via the arpanet; mit-multics then sends the message
- to joe@vanderbilt via MAILNET. Since the above machines each have access
- to the networks named in the address, this address will work correctly.
- .SH FILES
- /usr/lib/uucp/domains - Domain/gateway table
- .br
- /usr/lib/uucp/palias - Pathalias database
- .SH "SEE ALSO"
- opath(3), uupath(1), uumail(8)
- .br
- .B RFC 822 "Standard for the Format of ARPA Internet Text Messages"
- .br
- .B RFC 976 "UUCP Mail Interchange Format Standard"
- .SH AUTHOR
- Eric Roskos, CONCURRENT COMPUTERS
- SHAR_EOF
- if test 3735 -ne "`wc -c < 'address.1'`"
- then
- echo shar: error transmitting "'address.1'" '(should have been 3735 characters)'
- fi
- fi
- echo shar: extracting "'Alias.Design'" '(2472 characters)'
- if test -f 'Alias.Design'
- then
- echo shar: will not over-write existing file "'Alias.Design'"
- else
- cat << \SHAR_EOF > 'Alias.Design'
- This is the format for the Alias file used in uumail. It is derived from
- the Rand Mail Handler system (MH).
- Stan Barber 02/15/86
- ***************************************************************************
- This work in its current form is Copyright 1986 Stan Barber
- with the exception of opath, gethostname and the original getpath which
- as far as I know are in the Public Domain. This software may be distributed
- freely as long as no profit is made from such distribution and this notice
- is reproducted in whole.
- ***************************************************************************
-
- The Alias file for mail delivery is the file
-
- /usr/lib/uucp/Aliases
-
- Each line of the alias file has the format:
-
- match : alias
-
- Where:
-
- alias := simple-list
- | "<" alias-file
- | "=" UNIX-group
- | "|" program-name
-
- simple-list := simple-name
- | simple-list, simple-name
-
- Alias-file and program-name are fully qualified UNIX file names.
- UNIX-group is a group name from /etc/group. A simple-name is a
- local user login name, including only alphanumerics, `.' and `-'.
- Throughout this file case is ignored, except for alias-file and
- program-name.
-
- In match, a trailing * on a name will match anything. (See example
- below.)
-
- The procedure for mail aliasing is:
-
- 1) Build a list of all addresses from the message to be
- delivered, eliminating duplicates.
-
- 2) For each line in the alias file, compare "match" against all
- of the existing addresses. If a match, remove the matched
- name from the address list, and add each new alias name to the
- address list if it is not already on the list.
-
- 3) If output from uumail is to be sent to some other program, the pipe
- ("|") alias will cause output to be directly sent to that program instead
- of via mail.
-
- Since the alias file is read line by line, forward references
- work, but backward references are not recognized, thus, there is
- no recursion.
-
- E.g.:
-
- Borden: bruce
- Bruce: bsb
- Wharman: mike
- ASRL: bsb, mike, obrien, giarla
- UNIX-committee: < /usr/people/unix-committee
- System: = sys
- rnews: | /usr/lib/news/recnews
- ...
-
- In the "unix-committee" example, the file "/usr/people/unix-
- committee" contains one simple-name, or a list of comma separated
- simple-names. A new-line will be treated as a blank in this
- file, s.a.
-
- foo, fie,
- fum, fiddle
-
- In the "system" case, the names from the group "sys" will be used
- as the expanded name list.
-
- Originally by
- Bruce Borden October 1979
- SHAR_EOF
- if test 2472 -ne "`wc -c < 'Alias.Design'`"
- then
- echo shar: error transmitting "'Alias.Design'" '(should have been 2472 characters)'
- fi
- fi
- echo shar: extracting "'Sendmail'" '(1535 characters)'
- if test -f 'Sendmail'
- then
- echo shar: will not over-write existing file "'Sendmail'"
- else
- cat << \SHAR_EOF > 'Sendmail'
- ***************************************************************************
- This work in its current form is Copyright 1986 Stan Barber
- with the exception of opath, gethostname and the original getpath which
- as far as I know are in the Public Domain. This software may be distributed
- freely as long as no profit is made from such distribution and this notice
- is reproducted in whole.
- ***************************************************************************
-
- What I recommend for sendmail users is to use the following as the OPTIONS
- in the makefile:
-
- OPTIONS= -DGETHOSTNAME -DNOALIAS
- You may want to add either -DSORTED or -DDBM.
-
-
- Then edit the mailer definition for uucp in /usr/lib/sendmail.cf
- and change the P=/usr/bin/uux to be P=[where uumail is] (e.g.
- /usr/lib/uucp/uumail).
- Change the A= to A=uumail -h -f$g $h!$u
-
- This will replace the uux execution with uumail. If you do this exactly,
- you will only need the pathalias generated database to be present for
- uumail to work correctly. If you add -DOPATH to the OPTIONS line, you
- will need the domains file (/usr/lib/uucp/domains) correctly configured
- for your site. See opath.3 for more information.
-
- There are more things you can do to make sendmail be smarter about
- using uumail, but in general, this is not necessary since uumail
- will return informative messges to sendmail ( and the user) if
- there is a failure.
-
- If you would like to share your problems or ideas on interfacing
- sendmail and uumail, I would appreciate hearing them.
-
- Thanks.
- Stan Barber
- 15 March 1986
-
-
- SHAR_EOF
- if test 1535 -ne "`wc -c < 'Sendmail'`"
- then
- echo shar: error transmitting "'Sendmail'" '(should have been 1535 characters)'
- fi
- fi
- echo shar: extracting "'Binary.Only'" '(980 characters)'
- if test -f 'Binary.Only'
- then
- echo shar: will not over-write existing file "'Binary.Only'"
- else
- cat << \SHAR_EOF > 'Binary.Only'
- Unfortunately, you may not be able to alter your mail programs to utilize
- the features of uumail.
-
- However, I am providing a method for you to try experimentally. Please
- let me know if it works successfully for you.
-
- Mail usually works like this----
-
- mail --->Is it local? -->Yes-->put in mail box
- |
- No
- |
- --> uux --> uucp to destination machine
-
- What I am providing is a program that you put in place of uux to
- call uumail to route the mail for you. Then the map becomes---
-
- mail --->Is it local? -->Yes-->put in mail box
- |
- No
- |
- --> fakeuux --> Is it rmail? --> No --> realuux -->uucp
- |
- Yes
- |
- --> uumail --> realuux --> uucp
-
-
- Basically, you put the old uux in another place and put this fake uux in
- the original location. To try this feature, edit makefile and change the
- definition of REALUUX to match the place you will put your ORIGINAL uux
- program. Then type
- make fakeuux
-
- Good luck and let me know if it works.
- Stan Barber
- Feb 25, 1986
- SHAR_EOF
- if test 980 -ne "`wc -c < 'Binary.Only'`"
- then
- echo shar: error transmitting "'Binary.Only'" '(should have been 980 characters)'
- fi
- fi
- exit 0
- # End of shell archive
-